package com.zbj;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * TestController
 *
 * @author weigang
 * @create 2019-07-30
 **/
@RestController
@RequestMapping("/test")
public class TestController {

    @Autowired
    private DefaultListableBeanFactory defaultListableBeanFactory;

    @GetMapping("/get")
    public String get() {
        User user = defaultListableBeanFactory.getBean(User.class);
        user.setAddress("浙江省杭州市");
        return user.toString();
    }
}